package com.yanmaohu.yulia.bean;

import com.yanmaohu.yulia.statement.TriggeredSqlStatement;

/**
 * @author Bright Lee
 */
public final class TriggeredAction {

    private int beginIndex;
    private int endIndex;
    private boolean forEachRow;
    private boolean forEachStatement;
    private BooleanValueExpression searchCondition;
    private TriggeredSqlStatement triggeredSqlStatement;

    public TriggeredAction(int beginIndex,
                           boolean forEachRow,
                           boolean forEachStatement,
                           BooleanValueExpression searchCondition,
                           TriggeredSqlStatement triggeredSqlStatement) {
        this.beginIndex = beginIndex;
        this.endIndex = triggeredSqlStatement.getEndIndex();
        this.forEachRow = forEachRow;
        this.forEachStatement = forEachStatement;
        this.searchCondition = searchCondition;
        this.triggeredSqlStatement = triggeredSqlStatement;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public boolean isForEachRow() {
        return forEachRow;
    }

    public boolean isForEachStatement() {
        return forEachStatement;
    }

    public BooleanValueExpression getSearchCondition() {
        return searchCondition;
    }

    public TriggeredSqlStatement getTriggeredSqlStatement() {
        return triggeredSqlStatement;
    }

}
